<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Nome do Sistema</title>

	<h:outputStylesheet name="style.css" library="css" />
	<h:outputScript name="jtooltip.js" library="js" />
	<h:outputScript name="primefaceslocales.js" library="js" />
<style type="text/css" >

	
	@font-face{
		fonta-family: HelveticaNeueLT;
		src: url(../resources/default/fonts/HelveticaNeueLTCom-MdCn.otf);
	}
	
	
	.teste2{
	
		font-family: HelveticaNeueLT;
		font-size: 25px;
	
	}	
</style>
</h:head>

<h:body>

	<div id="headerPrincipal">
		<div class="wrapper" style="font-family:teste">Header</div>
	</div>
	<p:outputPanel autoUpdate="true">
		<p:messages id="mensagensContact" showDetail="false" rendered="#{facesContext.maximumSeverity eq 'INFO 0'}"
			showSummary="true" />
	</p:outputPanel>
	<div class="wrapper">
		<!-- end #header -->
		<div id="bodyPrincipal">
			<div id="content">
				<div class="content1">

					<h:form id="form">

						<p:treeTable id="treetable" value="#{documentsController.root}"
							var="document">
							<f:facet name="header">Document Viewer</f:facet>

							<p:column style="width:32%">
								<f:facet name="header">Nome Bundle</f:facet>
								<h:outputText value="#{document.name}" styleClass="teste" />
							</p:column>

							<p:column style="width:32%">
								<f:facet name="header">Size</f:facet>
								<h:outputText value="#{document.code}" styleClass="teste2" />
							</p:column>

							<p:column style="width:4%">
							
								<p:commandLink update=":form:documentPanel"
									rendered="#{document.type != 'FUNCTION'}"
									oncomplete="moduleDialog.show()" title="View Detail"
									styleClass="ui-icon ui-icon-plus">
									<f:setPropertyActionListener value="#{document}"
										target="#{documentsController.selectedDocument}" />
								</p:commandLink>
								<p:commandLink update=":form:removeModulePanel"
									rendered="#{document.type == 'MODULE'}"
									oncomplete="removeModuleDialog.show()" 
									title="Excluir Modulo ---BUNDLE"
									styleClass="ui-icon ui-icon-close">
									<f:setPropertyActionListener value="#{document}"
										target="#{documentsController.selectedDocument}" />
								</p:commandLink>
								<p:commandLink update=":form:documentPanel"
									rendered="#{document.type == 'FUNCTION'}"
									oncomplete="moduleDialog.show()" title="desassociar BUNDLE"
									styleClass="ui-icon ui-icon-extlink">
									<f:setPropertyActionListener value="#{document}"
										target="#{documentsController.selectedDocument}" />
								</p:commandLink>
							</p:column>
						</p:treeTable>

						<p:dialog id="moduleDialog" showHeader="false" resizable="false" showEffect="fade"
							widgetVar="moduleDialog" modal="true">
							<p:outputPanel id="documentPanel">
								<h:panelGrid columns="2" cellpadding="5"
									rendered="#{not empty documentsController.selectedDocument}">
									<ui:include src="moduleEdit.xhtml">
										<ui:param name="idRender" value=":form:treetable" />
									</ui:include>
								</h:panelGrid>
							</p:outputPanel>
						</p:dialog>
						
						<p:dialog id="removeModuleDialog" header="ds" showEffect="fade" widgetVar="removeModuleDialog" modal="true">
							<p:outputPanel id="removeModulePanel">
							--#{documentsController.selectedDocument}//
							#{not empty documentsController.selectedDocument}
								<h:panelGrid columns="2" cellpadding="5"
									rendered="#{not empty documentsController.selectedDocument}">
									<ui:include src="moduleRemove.xhtml">
										<ui:param name="idRender" value=":form:treetable" />
										<ui:param name="jsAction" value="removeModuleDialog.hide()" />
									</ui:include>
								</h:panelGrid>
							</p:outputPanel>
						</p:dialog>
						

					</h:form>


				</div>
				<div style="clear: both;">&nbsp;</div>
			</div>
			<!-- end #content -->
		</div>
		<!-- end #page -->

	</div>

	<div style="clear: both;">&nbsp;</div>

	<div id="footerPrincipal">
		<div class="wrapper"></div>
	</div>

</h:body>
</html>